from celery.schedules import crontab


class Config:
    CELERY_BROKER_URL = 'amqp://guest:064735@127.0.0.1:5672//'
    CELERY_RESULT_BACKEND = 'redis://:064735@127.0.0.1:6379/2'

    CELERY_BEAT_SCHEDULE = {
        'flush-route-protect-minute': {
            'task': 'scheCelery.tasks.flush_route_protect',
            'schedule': crontab(minute='*/1'),
            'args': ['minute']
        },
        'flush-route-protect-hour': {
            'task': 'scheCelery.tasks.flush_route_protect',
            'schedule': crontab(minute='*/1'),
            'args': ['hour']
        },
        'flush-route-protect-day': {
            'task': 'scheCelery.tasks.flush_route_protect',
            'schedule': crontab(minute='*/1'),
            'args': ['day']
        }
    }
    CELERY_TIMEZONE = 'Asia/Shanghai'

    # ====其他配置====
    database: dict = {
        'host': 'localhost',
        'port': 3306,
        'user': 'djangoSystem',
        'password': '064735Freedom?',
        'database': 'djangoProject'
    }
    django_backend: dict = {
        'host': 'http://localhost',
        'port': 8000
    }
